package com.sync.syncmasterdata.product.repository.BPM;

import com.sync.syncmasterdata.product.entity.BPM.InventoryForItemSheetEntity;
import com.sync.syncmasterdata.product.entity.BPM.InventoryLdtDeleteEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DelectLdtItemSheet extends JpaRepository<InventoryLdtDeleteEntity,String> {
    /**
     * 通过主表id获取需要停用的产品信息
     * @param id 主表id
     * @return 返回需要删除的产品信息
     */
    @Query(nativeQuery = true, value= "select id,parentId,inventory_code_txt,product_name,CRM_id,ERP_id from i0622_ldt_item_sheet where parentId=:id")
    List<InventoryLdtDeleteEntity> getDelectProduct(@Param(value = "id") String id);
}
